<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<html>
<head>
<!-- Copyright 1997 The Open Group, All Rights Reserved -->
<title>t_snddis</title>
</head><body bgcolor=white>
<center>
<font size=2>
The Single UNIX &reg; Specification, Version 2<br>
Copyright &copy; 1997 The Open Group

</font></center><hr size=2 noshade>
<h4>NAME</h4><blockquote>
t_snddis - send user-initiated disconnection request
</blockquote><h4>SYNOPSIS</h4><blockquote>
<pre><code>

#include &lt;<a href="xti.h.html">xti.h</a>&gt;

int t_snddis(
    int fd,
    const struct t_call *call)
</code>
</pre>
</blockquote><h4>DESCRIPTION</h4><blockquote>
<pre>
<P><table  bordercolor=#000000 border=1 align=center><tr valign=top><th align=center><b>Parameters</b>
<th align=center><b>Before call</b>
<th align=center><b>After call</b>
<tr valign=top><td align=left>fd
<td align=center>x
<td align=center>/
<tr valign=top><td align=left>call-&gt
<td align=center>addr.maxlen
<td align=center>=
<tr valign=top><td align=left>call-&gt
<td align=center>addr.len
<td align=center>=
<tr valign=top><td align=left>call-&gt
<td align=center>addr.buf
<td align=center>=
<tr valign=top><td align=left>call-&gt
<td align=center>opt.maxlen
<td align=center>=
<tr valign=top><td align=left>call-&gt
<td align=center>opt.len
<td align=center>=
<tr valign=top><td align=left>call-&gt
<td align=center>opt.buf
<td align=center>=
<tr valign=top><td align=left>call-&gt
<td align=center>udata.maxlen
<td align=center>=
<tr valign=top><td align=left>call-&gt
<td align=center>udata.len
<td align=center>x
<tr valign=top><td align=left>call-&gt
<td align=center>udata.buf
<td align=center>?(?)
<tr valign=top><td align=left>call-&gt
<td align=center>sequence
<td align=center>?
</table>
</pre>
<p>
This function is used to
initiate an abortive release on an already established connection, or
to reject a connection request.
The argument
<I>fd</I>
identifies the local transport endpoint of the connection, and
<I>call</I>
specifies information associated with the abortive release.
The argument
<I>call</I>
points to a
<B>t_call</B>
structure which contains the following members:
<pre>
<code>
struct netbuf addr;
struct netbuf opt;
struct netbuf udata;
int sequence;
</code>
</pre>
<p>
The values in
<I>call</I>
have different semantics, depending on the context of the call to
<i>t_snddis()</i>.
When rejecting a connection request,
<I>call</I>
must be non-null and contain a valid value of
<I>sequence</I>
to uniquely identify the rejected connection indication to the transport provider.
The
<I>sequence</I>
field is only meaningful if the transport connection is in the
T_INCON state.
The
<I>addr</I>
and
<I>opt</I>
fields of
<I>call</I>
are ignored.
In all other cases,
<I>call</I>
need only be used when data is being sent with the disconnection request.
The
<I>addr</I>,
<I>opt</I>
and
<I>sequence</I>
fields of the
<B>t_call</B>
structure are ignored.
If the user does not wish to send data to the remote user,
the value of
<I>call</I>
may be a null pointer.
<p>
The
<I>udata</I>
structure
specifies the user data to be sent to the remote user.
The amount of user data must not exceed the limits supported by
the transport provider, as returned
in the
<I>discon</I>
field, of the
<I>info</I>
argument of
<i><a href="t_open.html">t_open()</a></i>
or
<i><a href="t_getinfo.html">t_getinfo()</a></i>.
If the
<I>len</I>
field of
<I>udata</I>
is zero,
no data will be sent to the remote user.
</blockquote><h4>VALID STATES</h4><blockquote>
T_DATAXFER,T_OUTCON,T_OUTREL,T_INREL,T_INCON(ocnt &gt; 0)
</blockquote><h4>ERRORS</h4><blockquote>
On failure,
<I>t_errno</I>
is set to one of the following:
<dl compact>

<dt>[TBADF]<dd>The specified file descriptor does not refer to a transport endpoint.

<dt>[TBADDATA]<dd>The amount of user data specified was not within the bounds allowed by
the transport provider.

<dt>[TBADSEQ]<dd>An invalid sequence number was specified, or a
null
<I>call</I>
pointer
was specified, when rejecting a connection request.

<dt>[TLOOK]<dd>An asynchronous event, which requires attention, has occurred.

<dt>[TNOTSUPPORT]<dd>This function is not supported by the underlying transport
provider.

<dt>[TOUTSTATE]<dd>The communications endpoint referenced by 
<I>fd</I>
is not in one of the states in which a call to this function is valid.

<dt>[TPROTO]<dd>This error indicates that a communication problem has been detected between
XTI and the transport provider for which there is no other suitable XTI
error
<I>(t_errno)</I>.

<dt>[TSYSERR]<dd>A system error has occurred during execution of this function.

</dl>
</blockquote><h4>RETURN VALUE</h4><blockquote>
Upon successful completion, a value of 0 is returned.  Otherwise,
a value of -1 is returned and
<I>t_errno</I>
is set to indicate an error.
</blockquote><h4>SEE ALSO</h4><blockquote>
<i><a href="t_connect.html">t_connect()</a></i>,
<i><a href="t_getinfo.html">t_getinfo()</a></i>,
<i><a href="t_listen.html">t_listen()</a></i>,
<i><a href="t_open.html">t_open()</a></i>.
</blockquote><h4>CAVEATS</h4><blockquote>
<i>t_snddis()</i>
is an abortive disconnection. Therefore a
<i>t_snddis()</i>
issued on a connection endpoint  may cause data previously sent via
<i><a href="t_snd.html">t_snd()</a></i>,
or data not yet received, to be lost (even if an error is returned).
</blockquote><hr size=2 noshade>
<center><font size=2>
UNIX &reg; is a registered Trademark of The Open Group.<br>
Copyright &copy; 1997 The Open Group
<br> [ <a href="../index.html">Main Index</a> | <a href="../xshix.html">XSH</a> | <a href="../xcuix.html">XCU</a> | <a href="../xbdix.html">XBD</a> | <a href="../cursesix.html">XCURSES</a> | <a href="../xnsix.html">XNS</a> ]

</font></center><hr size=2 noshade>
</body></html>
